home *** CD-ROM | disk | FTP | other *** search
- /* %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
- % Copyright (C) 1994, by WATCOM International Inc. All rights %
- % reserved. No part of this software may be reproduced or %
- % used in any form or by any means - graphic, electronic or %
- % mechanical, including photocopying, recording, taping or %
- % information storage and retrieval systems - except with the %
- % written permission of WATCOM International Inc. %
- %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
- */
-
- #ifndef _WOLEPICT_HPP_INCLUDED
- #define _WOLEPICT_HPP_INCLUDED
-
- #ifndef _WNO_PRAGMA_PUSH
- #pragma pack(push,8);
- #pragma enum int;
- #endif
-
- #ifndef _WOLEAUTO_HPP_INCLUDED
- # include "woleauto.hpp"
- #endif
- #ifndef _WDSPHLPR_HPP_INCLUDED
- # include "wdsphlpr.hpp"
- #endif
- #ifndef _WRECT_HPP_INCLUDED
- # include "wrect.hpp"
- #endif
- #ifndef _WBITMAP_HPP_INCLUDED
- # include "wbitmap.hpp"
- #endif
- #ifndef _WPALETTE_HPP_INCLUDED
- # include "wpalette.hpp"
- #endif
- #ifndef _WMETAFIL_HPP_INCLUDED
- # include "wmetafil.hpp"
- #endif
-
- #define WPICTURE_SCALABLE 0x1l
- #define WPICTURE_TRANSPARENT 0x2l
-
- #define WPICTYPE_UNINITIALIZED ((WUInt)-1)
- #define WPICTYPE_NONE 0
- #define WPICTYPE_BITMAP 1
- #define WPICTYPE_METAFILE 2
- #define WPICTYPE_ICON 3
-
- typedef struct WPictDesc {
- WUInt picType;
- union {
- struct {
- WBitmapHandle hbitmap; // Bitmap
- WPaletteHandle hpal; // Accompanying palette
- } bmp;
-
- struct {
- WMetafileHandle hmeta; // Metafile
- WInt xExt;
- WInt yExt; // Extent
- } wmf;
-
- struct {
- WIconHandle hicon; // Icon
- } icon;
- };
- } WPictDesc;
-
- /*************************************************************************
- *
- * WPictureDisp -- Standard OLE Picture type dispatch helper
- *
- *
- * Events:
- *
- *
- *************************************************************************/
-
- class WCMCLASS WPictureDisp : public WOleDispatchHelper {
-
- public:
-
- /**********************************************************
- * Constructors and Destructors
- *********************************************************/
-
- WPictureDisp( WPIDispatch pIDispatch=NULL, WBool release=TRUE, WBool initMembers=TRUE );
- WPictureDisp( const WPictureDisp & pictureDisp );
- ~WPictureDisp();
-
-
- /**********************************************************
- * Properties
- *********************************************************/
-
- // Handle
- WShort GetHandle( void );
- WBool SetHandle( WShort handle );
-
- // HPal
- WShort GetHPal( void );
- WBool SetHPal( WShort hpal );
-
- // Type
- WShort GetType( void );
- WBool SetType( WShort type );
-
- // Width
- WLong GetWidth( void );
- WBool SetWidth( WLong width );
-
- // Height
- WLong GetHeight( void );
- WBool SetHeight( WLong height );
-
- /**********************************************************
- * Methods
- *********************************************************/
-
- WBool Render( WDeviceHandle hdc, WLong x, WLong y, WLong cx, WLong cy,
- WOLE_XPOS_HIMETRIC xSrc, WOLE_YPOS_HIMETRIC ySrc,
- WOLE_XSIZE_HIMETRIC cxSrc, WOLE_YSIZE_HIMETRIC cySrc,
- WRect & prcWBounds );
-
- /**************************************************************
- * Operators
- **************************************************************/
-
- WPictureDisp & operator=( const WPictureDisp & pictureDisp );
-
- /**********************************************************
- * Data
- *********************************************************/
- };
-
- /*************************************************************************
- *
- * WIPicture -- Standard OLE Picture type
- *
- *
- * Events:
- *
- *
- *************************************************************************/
-
- class WCMCLASS WIPicture : public WObject {
- WDeclareSubclass( WIPicture, WObject );
-
- public:
-
- /**********************************************************
- * Constructors and Destructors
- *********************************************************/
-
- WIPicture();
- WIPicture( WPIPicture ipicture );
- WIPicture( const WIPicture & ipicture );
- WIPicture( const WPictDesc & pd, WBool pictureOwnsHandle=TRUE );
- WIPicture( const WBitmap & bitmap );
- WIPicture( const WIcon & icon );
- WIPicture( const WMetafile & metafile, WInt xExt=0, WInt yExt=0 );
- virtual ~WIPicture();
-
- public:
-
- /**************************************************************
- * Properties
- **************************************************************/
-
- WOLE_HANDLE GetHandle( void ) const;
- WOLE_HANDLE GetHPal( void ) const;
- WShort GetType( void ) const;
- WOLE_XSIZE_HIMETRIC GetWidth( void ) const;
- WOLE_YSIZE_HIMETRIC GetHeight( void ) const;
- WBool SetHPal( WOLE_HANDLE hpal );
- WDeviceHandle GetCurDC( void ) const;
- WBool GetKeepOriginalFormat( void ) const;
- WBool SetKeepOriginalFormat( WBool fkeep );
- WULong GetAttributes( void ) const;
-
- WPIPicture GetIPicture( void ) const;
- WPIDispatch GetIDispatch( void ) const;
- WPictureDisp GetPictureDisp( void ) const;
-
- /**********************************************************
- * Methods
- *********************************************************/
-
- // Creation Methods
- static WIPicture *CreatePicture( void );
- static WIPicture *CreatePictureIndirect( const WPictDesc & pd,
- WBool pictureOwnsHandle=TRUE
- );
- static WIPicture *LoadPicture( const WPIStream stream, WLong size=0,
- WBool keepOriginalFormat=TRUE );
-
- // IPicture Methods
- WBool Render( WDeviceHandle hdc, WLong x, WLong y, WLong cx, WLong cy,
- WOLE_XPOS_HIMETRIC xSrc, WOLE_YPOS_HIMETRIC ySrc,
- WOLE_XSIZE_HIMETRIC cxSrc, WOLE_YSIZE_HIMETRIC cySrc,
- WRect & prcWBounds );
- WBool SelectPicture( WDeviceHandle hdcIn, WDeviceHandle & phdcOut,
- WOLE_HANDLE & phbmpOut );
- WBool PictureChanged( void );
- WBool SaveAsFile( WPIStream lpstream, WBool fSaveMemCopy,
- WLong & pcbSize );
-
- /**************************************************************
- * Operators
- **************************************************************/
-
- WIPicture & operator=( const WIPicture & picture );
-
- /**********************************************************
- * Data Members
- *********************************************************/
-
- private:
- WPIPicture _ipicture;
- };
-
- #ifndef _WNO_PRAGMA_PUSH
- #pragma enum pop;
- #pragma pack(pop);
- #endif
-
- #endif // _WOLEFONT_HPP_INCLUDED
-
-